package com.mhys.ynnz_ssm.business.sys.controller;

import com.mhys.ynnz_ssm.business.sys.dto.LogDO;
import com.mhys.ynnz_ssm.business.sys.service.SysLogService;
import com.mhys.ynnz_ssm.core.dto.MyPager;
import com.mhys.ynnz_ssm.core.dto.MyResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 日志管理控制器
 * 2024/6/14
 */
@Controller
@RequestMapping("/mylog")
@Slf4j
public class LogController {

    @Resource(name = "sysLogServiceImpl")
    private SysLogService sysLogService;

    /**
     * 日志分页记录
     * @param logDO 日志查询参数
     * @param pager 日志分页参数
     * @return
     */
    @GetMapping("/getLogPages")
    @ResponseBody
    public MyResult getLogPages(LogDO logDO, MyPager pager){

        log.info("--文件信息分页列表：logDO："+logDO+";pager:"+pager);

        MyResult result = new MyResult<>();

        MyPager<LogDO> pages= sysLogService.getLogPages(logDO,pager);

        result.setMsg("查询成功！");
        result.setData(pages);

        return result;
    }

}
